@import "variables.module.scss";

.el-header {
  height: $el-header-height;
  padding: 0 0;

  .nav-bar {
    height: $nav-height;
    width: 100%;
    padding: 0 0;
    position: relative;

    .hamburger-container {
      line-height: 74px;
      width: $nav-height;
      height: $nav-height;
      float: left;
      cursor: pointer;
      transition: background 0.3s;
      -webkit-tap-highlight-color: transparent;

      &:hover {
        background: rgba(0, 0, 0, 0.025);
      }

      .el-icon__hamburger {
        margin: 21px;
        font-size: $font-size__hamburger;
      }
    }

    .tags-view-container {
      height: $nav-height__tagsView;
      border-bottom: 1px solid #d8dce5;
      box-shadow: $tags-view-box-shadow;

      .scroll-container {
        width: 100%;
        height: $nav-height__tagsView;
        overflow: hidden;
        display: flex;
        white-space: nowrap;
      }

      .tags-view-item {
        text-decoration: none;
        display: inline-block;
        position: relative;
        cursor: pointer;
        height: 24px;
        line-height: 22px;
        border: 1px solid #d8dce5;
        color: #495060;
        background: #fff;
        padding: 0 8px;
        font-size: 12px;
        margin-left: 5px;
        margin-top: 2px;

        &:first-of-type {
          margin-left: 15px;
        }

        &:last-of-type {
          margin-right: 15px;
        }

        &.active {
          background-color: #42b983;
          color: #fff;
          border-color: #42b983;

          &::before {
            content: "";
            background: #fff;
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            position: relative;
            margin-right: 2px;
          }
        }
      }

      .contextmenu {
        margin: 0;
        background: #fff;
        z-index: 3000;
        position: absolute;
        list-style-type: none;
        padding: 5px 0;
        border-radius: 4px;
        font-size: 12px;
        font-weight: 400;
        color: #333;
        box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);

        li {
          margin: 0;
          padding: 7px 16px;
          cursor: pointer;

          &:hover {
            background: #eee;
          }
        }
      }
    }

    .tags-view-wrapper {
      .tags-view-item {
        .el-icon-close {
          width: 16px;
          height: 16px;
          vertical-align: 2px;
          border-radius: 50%;
          text-align: center;
          transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
          transform-origin: 100% 50%;

          &:before {
            transform: scale(0.6);
            display: inline-block;
            vertical-align: -3px;
          }

          &:hover {
            background-color: #b4bccc;
            color: #fff;
            width: 12px !important;
            height: 12px !important;
          }
        }
      }
    }

    .right-menu {
      float: right;
      height: $nav-height;
      line-height: $nav-height;
      display: flex;

      &:focus {
        outline: none;
      }

      .right-menu-item {
        display: inline-block;
        padding: 0 8px;
        font-size: $font-size__right-menu-item;
        color: #5a5e66;
        vertical-align: text-bottom;

        &.hover-effect {
          cursor: pointer;
          transition: background 0.3s;

          &:hover {
            background: rgba(0, 0, 0, 0.025);
          }
        }
      }

      // 搜索
      .header-search {
        font-size: 0 !important;

        .search-icon {
          cursor: pointer;
          font-size: $font-size__search-icon;
          vertical-align: middle;
          margin-bottom: 2px;
        }

        .header-search-select {
          font-size: $font-size__header-search-select;
          transition: width 0.2s;
          width: 0;
          overflow: hidden;
          background: transparent;
          border-radius: 0;
          display: inline-block;
          vertical-align: middle;

          :deep(.el-input__inner) {
            border-radius: 0;
            border: 0;
            padding-left: 0;
            padding-right: 0;
            box-shadow: none !important;
            border-bottom: 1px solid #d9d9d9;
            vertical-align: middle;
          }
        }

        &.show {
          .header-search-select {
            width: 210px;
            margin-left: 10px;
          }
        }
      }

      // 布局大小
      .size-icon {
        font-size: $font-size__size-icon;
        line-height: $nav-height;
      }

      // 头像
      .avatar-container {
        margin-top: 10px;
        margin-right: 40px;

        .avatar-wrapper {
          position: relative;

          .user-avatar {
            cursor: pointer;
            width: 40px;
            height: 40px;
            border-radius: 10px;
          }

          i {
            cursor: pointer;
            position: absolute;
            right: -20px;
            top: 25px;
            font-size: 12px;
          }
        }
      }
    }
  }
}